package com.zmx.patientend.fragment;

import android.app.ActionBar;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;

import androidx.annotation.Nullable;

import com.gyf.immersionbar.ImmersionBar;
import com.netease.nimlib.sdk.avchat.AVChatCallback;
import com.netease.nimlib.sdk.avchat.AVChatManager;
import com.netease.nimlib.sdk.avchat.constant.AVChatType;
import com.netease.nimlib.sdk.avchat.model.AVChatData;
import com.netease.nimlib.sdk.avchat.model.AVChatNotifyOption;
import com.netease.nimlib.sdk.avchat.video.AVChatVideoCapturerFactory;
import com.zmx.patientend.MyApplication;
import com.zmx.patientend.R;
import com.zmx.patientend.view.activity.AllDoctorActivity;
import com.zmx.patientend.view.activity.COVIDActivity;
import com.zmx.patientend.view.activity.FamousDoctorHallActivity;
import com.zmx.patientend.view.activity.LoginActivity;
import com.zmx.patientend.view.activity.TongueCoatingActivity;

/**
 * 问诊
 */
public class PhysicianFragment extends SimpleImmersionFragment implements View.OnClickListener{

    private RelativeLayout relayout1,relayout2,relayout3;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_physician, container, false);
        relayout1 = view.findViewById(R.id.relayout1);
        relayout1.setOnClickListener(this);
        relayout2 = view.findViewById(R.id.relayout2);
        relayout2.setOnClickListener(this);
        relayout3 = view.findViewById(R.id.relayout3);
        relayout3.setOnClickListener(this);
              return view;

    }

    @Override
    public void initImmersionBar() {
        ImmersionBar.with(this).titleBarMarginTop(R.id.toolbar) .statusBarDarkFont(true).init();
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        switch (v.getId()){

            case R.id.relayout1:

                if (!MyApplication.isLogin_state()){

                    intent.setClass(this.getContext(), LoginActivity.class);
                    startActivityForResult(intent,10);

                }else{

                    intent.setClass(this.getContext(), AllDoctorActivity.class);
                    startActivity(intent);


                }


                break;
            case R.id.relayout2:

                if (!MyApplication.isLogin_state()){

                    intent.setClass(this.getContext(), LoginActivity.class);
                    startActivityForResult(intent,10);

                }else{

                    intent.setClass(this.getContext(), FamousDoctorHallActivity.class);
                    startActivity(intent);

                }

                break;
            case R.id.relayout3:
                if (!MyApplication.isLogin_state()){

                    intent.setClass(this.getContext(), LoginActivity.class);
                    startActivityForResult(intent,10);

                }else{

                    intent.setClass(this.getContext(), TongueCoatingActivity.class);
                    startActivity(intent);

                }
                break;

        }



    }



}
